/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmAttachment extends BasicModel<PmAttachment> {
  projectid?: string; // 项目ID
  projectno?: string; // 项目编码
  attachmentname?: string; // 文件名称
  fileuploadurlnode?: number; // 文件类型编码
  fileuploadurlname?: string; // 文件类型名称
  attachmentpath?: string; // 文件地址
  filetype?: string; // 文件格式
  uploadorname?: string; // 录入人
  isdesignerchange?: number; // 是否为设计变更
  designerchangeno?: string; // 设计变更编号
  taskid?: string; // taskid
  issplitproject?: number; // 是否分单
  splitprojectno?: string; // splitprojectno
  isotherinfo?: number; // isotherinfo
  otherinfokeyid?: string; // otherinfokeyid
  isstopdegreeornum?: number; // isstopdegreeornum
  usercardno?: string; // usercardno
  createDate?: string; // 录入时间
  name?: string; // name
  dcreatetime?: string; // dcreatetime
  fileid?: string; // fileid
}

export const pmAttachmentList = (params?: PmAttachment | any) =>
  defHttp.get<PmAttachment>({ url: adminPath + '/proj/attachment/pmAttachment/list', params });

export const pmAttachmentListData = (params?: PmAttachment | any) =>
  defHttp.post<Page<PmAttachment>>({
    url: adminPath + '/proj/attachment/pmAttachment/listData',
    params,
  });

export const pmAttachmentForm = (params?: PmAttachment | any) =>
  defHttp.get<PmAttachment>({ url: adminPath + '/proj/attachment/pmAttachment/form', params });

export const pmAttachmentSave = (params?: any, data?: PmAttachment | any) =>
  defHttp.postJson<PmAttachment>({
    url: adminPath + '/proj/attachment/pmAttachment/save',
    params,
    data,
  });

export const pmAttachmentDelete = (params?: PmAttachment | any) =>
  defHttp.get<PmAttachment>({ url: adminPath + '/proj/attachment/pmAttachment/delete', params });

export const pmAttachmentCheck = (params?: PmAttachment | any) =>
  defHttp.post<PmAttachment>({ url: '/proj/attachment/pmAttachment/check', params });

export const pmAttachmentRefreshFromBz = (params?: PmAttachment | any) =>
  defHttp.post<PmAttachment>({
    url: adminPath + '/proj/attachment/pmAttachment/refreshFromBz',
    params,
  });
